home *** CD-ROM | disk | FTP | other *** search
/ Holt Researcher: American History / Holt Researcher: American History.iso / pc / modules / dbtable.dxr / 00007_span header subtable.ls < prev    next >
Encoding:
Text File  |  2000-01-18  |  2.3 KB  |  95 lines

  1. property ancestor
  2.  
  3. on new me, tableName, castName, tableChannel, xLoc, vSlider, HSlider, descendant
  4.   if objectp(descendant) then
  5.     PassVar = descendant
  6.   else
  7.     PassVar = me
  8.   end if
  9.   ancestor = new(script("subtable object"), tableName, castName, tableChannel, xLoc, vSlider, HSlider, PassVar)
  10.   return me
  11. end
  12.  
  13. on GetScrollLeftIncrement me
  14.   if IsTableVisible(me) then
  15.     LeftCell = getMouseCell(me._me, me.pL + 2, me.pT + 2)
  16.     NextLeftColumn = getAt(LeftCell, 1) - 1
  17.     if NextLeftColumn = 0 then
  18.       NextLeftColumn = 1
  19.     end if
  20.     return (getColumnWidth(member(me.pTable), NextLeftColumn) - 1) * (getSetting(me.pHSlider) - 1)
  21.   end if
  22. end
  23.  
  24. on GetScrollRightIncrement me
  25.   if IsTableVisible(me) then
  26.     if maxReached(me.pHSlider) then
  27.       return me.pSpriteWidth
  28.     else
  29.       LeftCell = getMouseCell(me._me, me.pL + 2, me.pT + 2)
  30.       return (getColumnWidth(member(me.pTable), getAt(LeftCell, 1)) - 1) * (getSetting(me.pHSlider) - 1)
  31.     end if
  32.   end if
  33. end
  34.  
  35. on EvalSetTableMin me
  36.   if IsTableVisible(me) then
  37.     if getNumColumns(me) = 1 then
  38.       setColumnWidth(member(me.pTable), 1, me.pMinRect.width)
  39.     else
  40.       SetTableMin(me)
  41.     end if
  42.   end if
  43. end
  44.  
  45. on EvalSetTableMax me, xMax
  46.   if IsTableVisible(me) then
  47.     if getNumColumns(me) = 1 then
  48.       setColumnWidth(member(me.pTable), 1, xMax - me.pL)
  49.     else
  50.       SetTableMax(me, xMax)
  51.     end if
  52.   end if
  53. end
  54.  
  55. on scrollLeft me, HScrollIncrement
  56.   if IsTableVisible(me) then
  57.     sprite(me.pTableChannel).hScroll = HScrollIncrement
  58.   end if
  59.   return me
  60. end
  61.  
  62. on scrollRight me, HScrollIncrement
  63.   if IsTableVisible(me) then
  64.     sprite(me.pTableChannel).hScroll = HScrollIncrement
  65.   end if
  66.   return me
  67. end
  68.  
  69. on CalcCenterofRect me, xRect
  70.   if the machineType = 256 then
  71.     l = getAt(xRect, 1)
  72.     t = getAt(xRect, 2)
  73.     R = getAt(xRect, 3)
  74.     b = getAt(xRect, 4)
  75.     xCenter = (R - l) / 2
  76.     if ((l mod 2) = 1) and ((R mod 2) = 1) then
  77.       xCenter = xCenter - 1
  78.     end if
  79.     if ((l mod 2) = 0) and ((R mod 2) = 0) then
  80.       xCenter = xCenter - 1
  81.     end if
  82.     if ((l mod 2) = 1) and ((R mod 2) = 0) then
  83.       xCenter = xCenter - 1
  84.     end if
  85.     yCenter = (b - t) / 2
  86.     if ((t mod 2) = 0) and ((b mod 2) = 0) then
  87.       yCenter = yCenter - 1
  88.     end if
  89.     xPoint = point(l + xCenter, t + yCenter)
  90.   else
  91.     xPoint = RectToLoc(xRect)
  92.   end if
  93.   return xPoint
  94. end
  95.